<template>
  <div class="yl-page text-right">
    <el-pagination
      :current-page="$attrs.page"
      :page-sizes="[5, 8, 10, 12, 15, 20, 25]"
      :page-size="$attrs.size"
      layout="total, sizes, prev, pager, next, jumper"
      :total="$attrs.total"
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange">
    </el-pagination>
  </div>
</template>

<script>
export default {
  name: 'YlPage',
  data () {
    return {
    }
  },
  methods: {
    handleSizeChange (val) {
      this.$emit('page-size', val)
    },
    handleCurrentChange (val) {
      this.$emit('current-page', val)
    }
  }
}
</script>

<style lang="scss" scoped>
  .yl-page {
    margin: 10px auto;
  }
</style>
